import { IRoute } from "umi-types";

const routes: IRoute = [
  {
    path: '/user',
    component: '../layouts/UserLayout',
    routes: [
      {
        name: 'login',
        path: '/user/login',
        component: './user/login',
      },
    ],
  },
  {
    path: '/',
    component: '../layouts/SecurityLayout',
    routes: [
      {
        path: '/',
        component: '../layouts/BasicLayout',
        authority: ['admin', 'user'],
        routes: [
          {
            path: '/',
            redirect: '/welcome',
          },
          {
            path: '/welcome',
            name: 'welcome',
            icon: 'smile',
            component: './Welcome',
          },
          {
            name: 'dashboard',
            path: '/dashboard',
            icon: 'dashboard',
            routes: [
              {
                name: 'analysis',
                path: '/dashboard/analysis',
                component: './dashboard/analysis',
              },
              {
                name: 'monitor',
                path: '/dashboard/monitor',
                component: './dashboard/monitor',
              },
              {
                name: 'workplace',
                path: '/dashboard/workplace',
                component: './dashboard/workplace',
              },
            ],
          },
          {
            name: 'customer',
            path: '/customer',
            icon: 'user',
            locale: false,
            routes: [
              {
                name: 'information',
                path: '/customer/information',
                component: './customer/information',
              },
            ],
          },
          {
            name: 'template',
            path: '/template',
            icon: 'ant-design',
            locale: false,
            routes: [
              {
                name: 'flow',
                path: '/template/flow',
                component: './template/flow',
              },
              {
                name: 'drag',
                path: '/template/drag',
                component: './template/drag',
              },
            ],
          },
          {
            component: './404',
          },
        ],
      },
      {
        component: './404',
      },
    ],
  },
  {
    component: './404',
  },
];

export default routes;
